#ifndef _DRV_CAN_H
#define _DRV_CAN_H
#include "sys_hc32f460.h"

#define CAN_FILTERS_COUNT           (1u)
#define CAN_RX_PORT    PortC
#define CAN_RX_PIN     Pin08
#define CAN_TX_PORT    PortC
#define CAN_TX_PIN     Pin07

typedef struct{
	uint32_t stdId;
	uint32_t ExtId;
	uint8_t  dataLen;
	uint8_t  data[8];
	uint8_t	 recv_ok_flag;
}CanTransData_t;

typedef struct{
	uint8_t conf_prsec;
	uint8_t conf_seg1;
	uint8_t conf_seg2;
	uint8_t conf_sjw;
}CanConfigData_t;

void drv_can_init(uint8_t prsec,uint8_t seg1,uint8_t seg2,uint8_t sjw);
uint8_t can_send_msg(CanTransData_t *msg);
CanTransData_t *getCanRecvInfo(void);
void drv_can_sleep_enter(void);
void drv_can_sleep_exit(void);
#endif
